home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / RenderLib.lha / RenderLib / doc / autodoc / render.doc < prev    next >
Encoding:
Text File  |  1997-07-01  |  83.2 KB  |  2,417 lines

  1. TABLE OF CONTENTS
  2.  
  3. render.library/AddChunkyImageA
  4. render.library/AddHistogramA
  5. render.library/AddRGB
  6. render.library/AddRGBImageA
  7. render.library/AllocRenderMem
  8. render.library/AllocRenderVec
  9. render.library/AllocRenderVecClear
  10. render.library/ApplyAlphaChannelA
  11. render.library/BestPen
  12. render.library/Chunky2BitMapA
  13. render.library/Chunky2RGBA
  14. render.library/ChunkyArrayDiversityA
  15. render.library/ConvertChunkyA
  16. render.library/CountRGB
  17. render.library/CreateAlphaArrayA
  18. render.library/CreateHistogramA
  19. render.library/CreateMapEngineA
  20. remder.library/CreatePaletteA
  21. render.library/CreatePenTableA
  22. render.library/CreateRMHandlerA
  23. render.library/CreateScaleEngineA
  24. render.library/DeleteHistogram
  25. render.library/DeleteMapEngine
  26. render.library/DeletePalette
  27. render.library/DeleteRMHandler
  28. render.library/DeleteScaleEngine
  29. render.library/ExportPaletteA
  30. render.library/ExtractAlphaChannelA
  31. render.library/ExtractPaletteA
  32. render.library/FlushPalette
  33. render.library/FreeRenderMem
  34. render.library/FreeRenderVec
  35. render.library/ImportPaletteA
  36. render.library/InsertAlphaChannelA
  37. render.library/MapChunkyArrayA
  38. render.library/MapRGBArrayA
  39. render.library/MixAlphaChannelA
  40. render.library/MixRGBArrayA
  41. render.library/Planar2ChunkyA
  42. render.library/QueryHistogram
  43. render.library/RenderA
  44. render.library/RGBArrayDiversityA
  45. render.library/ScaleA
  46. render.library/ScaleOrdinate
  47. render.library/SortPaletteA
  48. render.library/AddChunkyImageA                 render.library/AddChunkyImageA
  49.  
  50.    NAME
  51.         AddChunkyImageA - add chunky bytes to a histogram.
  52.         AddChunkyImage  - varargs stub for AddChunkyImageA.
  53.  
  54.    SYNOPSIS
  55.         success = AddChunkyImageA(histogram,chunky,width,height,
  56.         d0                        a0        a1     d0    d1     
  57.                                   palette,taglist)
  58.                                   a2      a3
  59.         
  60.         ULONG AddChunkyImageA(APTR,UBYTE *,UWORD,UWORD,
  61.                               APTR,struct TagItem *)
  62.         
  63.         ULONG AddChunkyImage(APTR,UBYTE *,UWORD,UWORD,
  64.                              APTR,tag,...,TAG_DONE)
  65.  
  66.    FUNCTION
  67.         This function adds an array of chunky bytes to a histogram. The
  68.         color information contained in the chunky array and its palette
  69.         will be stored in the histogram.
  70.  
  71.    INPUTS
  72.         histogram       - pointer to a histogram
  73.         chunky          - pointer to an array of chunky bytes
  74.         width           - width to be added [pixels]
  75.         height          - lines to be added [rows]
  76.         palette         - pointer to a palette
  77.                           created with CreatePaletteA()
  78.         taglist         - pointer to an array of TagItems
  79.  
  80.    TAGS
  81.         RND_SourceWidth (UWORD) - Total width of the chunky array [pixels].
  82.                 Default - equals to the specified width.
  83.  
  84.         RND_ProgressHook (ULONG) - Pointer to a callback hook
  85.                 structure for progress display operations. Refer to
  86.                 render/renderhooks.h for further information.
  87.                 Default - NULL.
  88.         
  89.    RESULTS
  90.         success - return value to indicate whether the operation succeeded.
  91.                   You must at least check for ADDH_SUCCESS. Adding data to
  92.                   histograms may fail at any time and the histogram may
  93.                   thereof get inaccurate.
  94.  
  95.    NOTES
  96.         - It is not possible with this function to directly add a chunky
  97.           array that represents a HAM color scheme. In this case you have
  98.           to convert it to an RGB array via Chunky2RGBA(), and then to
  99.           call AddRGBImageA().
  100.            
  101.         - This function may call the progress callback Hook with
  102.           the PMSGTYPE_LINES_ADDED message.
  103.         
  104.    SEE ALSO
  105.         AddRGBImageA(), CreateHistogramA(), render/renderhooks.h
  106.  
  107.  
  108. render.library/AddHistogramA                     render.library/AddHistogramA
  109.  
  110.    NAME
  111.         AddHistogramA - add a histogram to another histogram.
  112.         AddHistogram  - varargs stub for AddHistogramA.
  113.  
  114.    SYNOPSIS
  115.         success = AddHistogramA(desthistogram,sourcehistogram,taglist)
  116.         d0                      a0            a1              a2
  117.         
  118.         ULONG AddHistogramA(APTR,APTR,struct TagItem *)
  119.         
  120.         ULONG AddHistogram(APTR,APTR,tag,...,TAG_DONE)
  121.  
  122.    FUNCTION
  123.         This function adds a histogram to another histogram,
  124.         according to the following scheme:
  125.         
  126.         desthistogram + sourcehistogram -> desthistogram
  127.         
  128.         The color information contained in the source histogram
  129.         will be added to the destination histogram.
  130.  
  131.    INPUTS
  132.         desthistogram       - pointer to destination histogram
  133.         sourcehistogram     - pointer to source histogram
  134.         taglist             - pointer to an array of TagItems
  135.  
  136.    TAGS
  137.         RND_Weight (UWORD)  - multiplication factor for the
  138.                 number of representations in sourcehistogram
  139.  
  140.    RESULTS
  141.         success - return value to indicate whether the operation succeeded.
  142.                   You must at least check for ADDH_SUCCESS. Adding data to
  143.                   histograms may fail at any time and the histogram may
  144.                   thereof get inaccurate.
  145.        
  146.    SEE ALSO
  147.         CreateHistogramA()
  148.  
  149.  
  150. render.library/AddRGB                                   render.library/AddRGB
  151.  
  152.    NAME
  153.         AddRGB - add a RGB value to a histogram.
  154.  
  155.    SYNOPSIS
  156.         success = AddRGB(histogram,RGB,count)
  157.         d0               a0        d0  d1
  158.         
  159.         ULONG AddRGB(APTR,ULONG,ULONG)
  160.  
  161.    FUNCTION
  162.         This function adds a given number of representations for a
  163.         single RGB value to a histogram.
  164.  
  165.    INPUTS
  166.         histogram    - pointer to a histogram
  167.         RGB          - RGB value to be added
  168.         count        - number of representations for that RGB value
  169.  
  170.    RESULTS
  171.         success - return value to indicate whether the operation succeeded.
  172.                   You must at least check for ADDH_SUCCESS. Adding data to
  173.                   histograms may fail at any time and the histogram may
  174.                   thereof get inaccurate.
  175.  
  176.    SEE ALSO
  177.         AddRGBImageA(), CreateHistogramA()
  178.  
  179.  
  180. render.library/AddRGBImageA                       render.library/AddRGBImageA
  181.  
  182.    NAME
  183.         AddRGBImageA - add an array of RGB data to a histogram.
  184.         AddRGBImage  - varargs stub for AddRGBImageA.
  185.  
  186.    SYNOPSIS
  187.         success = AddRGBImageA(histogram,rgb,width,height,taglist)
  188.         d0                     a0        a1  d0    d1     a2
  189.         
  190.         ULONG AddRGBImageA(APTR,ULONG *,UWORD,UWORD,struct TagItem *)
  191.         
  192.         ULONG AddRGBImage(APTR,ULONG *,UWORD,UWORD,tag,...,TAG_DONE) 
  193.  
  194.    FUNCTION
  195.         This function adds an array of RGB pixels to a histogram. The
  196.         color information contained in the RGB array gets stored in the
  197.         histogram.
  198.  
  199.    INPUTS
  200.         histogram       - pointer to a histogram
  201.         rgb             - pointer to an array of RGB data
  202.         width           - width to be added [pixels]
  203.         height          - lines to be added [rows]
  204.         taglist         - pointer to an array of TagItems
  205.  
  206.    TAGS
  207.         RND_SourceWidth (UWORD) - Total width of the RGB array [pixels].
  208.                 Default - equals to the specified width.
  209.  
  210.         RND_ProgressHook (ULONG) - Pointer to a callback hook
  211.                 structure for progress display operations. Refer to
  212.                 render/renderhooks.h for further information.
  213.                 Default - NULL.
  214.  
  215.    RESULTS
  216.         success - return value to indicate whether the operation succeeded.
  217.                   You must at least check for ADDH_SUCCESS. Adding data to
  218.                   histograms may fail at any time and the histogram may
  219.                   thereof get inaccurate.
  220.  
  221.    NOTES
  222.         - This function may call the progress callback Hook with
  223.           the PMSGTYPE_LINES_ADDED message.
  224.         
  225.    SEE ALSO
  226.         AddRGB(), CreateHistogramA(), render/renderhooks.h
  227.  
  228.  
  229. render.library/AllocRenderMem                   render.library/AllocRenderMem
  230.  
  231.    NAME
  232.         AllocRenderMem - allocate memory from a render-memhandler.
  233.  
  234.    SYNOPSIS
  235.         mem = AllocRenderMem(rendermemhandler,size)
  236.         d0                   a0               d0
  237.  
  238.         APTR AllocRenderMem(APTR, ULONG)
  239.  
  240.    FUNCTION
  241.         AllocRenderMem will allocate a memory block from a
  242.         render-memhandler, or from public memory. If there is no memory
  243.         block of the requested size available, NULL will be returned.
  244.         You must check this return value. The request may fail at any
  245.         time. Every call to this function must be followed by a call to
  246.         FreeRenderMem.
  247.  
  248.    INPUTS
  249.         rendermemhandler - pointer to a render-memhandler, or NULL.
  250.                            If you pass NULL, MEMF_ANY will be used.
  251.         size             - the size of the desired block in bytes
  252.  
  253.    RESULTS
  254.         mem              - pointer to a block of memory, or NULL if the
  255.                            allocation failed.
  256.  
  257.    NOTES
  258.         There is no real need for this function being available to you,
  259.         except for helping you to create a smart, lean and sexy memory
  260.         management - the idea is to enable your application and the
  261.         library to share a particular memory pool.
  262.  
  263.    SEE ALSO
  264.         FreeRenderMem(), AllocRenderVec(), CreateRMHandlerA()
  265.  
  266.  
  267. render.library/AllocRenderVec                   render.library/AllocRenderVec
  268.  
  269.    NAME
  270.         AllocRenderVec - allocate memory from a render-memhandler, 
  271.                          and keep track of the allocated size and
  272.                          the memhandler itself.
  273.  
  274.    SYNOPSIS
  275.         mem = AllocRenderVec(rendermemhandler,size)
  276.         d0                   a0               d0
  277.  
  278.         APTR AllocRenderVec(APTR, ULONG)
  279.  
  280.    FUNCTION
  281.         AllocRenderVec will allocate a memory block from a
  282.         render-memhandler, or from public memory. If there is no memory
  283.         block of the requested size available, NULL will be returned.
  284.         You must check this return value. The request may fail at any
  285.         time. Any call to this function must be followed by a call to
  286.         FreeRenderVec(). AllocRenderVec() keeps track of the allocated
  287.         size and the memhandler itself.
  288.  
  289.    INPUTS
  290.         rendermemhandler - pointer to a render-memhandler, or NULL.
  291.                            If you pass NULL, MEMF_ANY will be used.
  292.         size             - the size of the desired block in bytes
  293.  
  294.    RESULTS
  295.         mem              - pointer to a block of memory, or NULL
  296.                            if the allocation failed.
  297.  
  298.    SEE ALSO
  299.         FreeRenderVec(), AllocRenderVecClear(), AllocRenderMem(),
  300.         CreateRMHandlerA()
  301.  
  302.  
  303. render.library/AllocRenderVecClear         render.library/AllocRenderVecClear
  304.  
  305.    NAME
  306.         AllocRenderVecClear - allocate a clear block of memory from a
  307.                               render-memhandler
  308.  
  309.    SYNOPSIS
  310.         mem = AllocRenderVecClear(rendermemhandler,size)
  311.         d0                        a0               d0
  312.  
  313.         APTR AllocRenderVecClear(APTR, ULONG)
  314.  
  315.    FUNCTION
  316.         AllocRenderVecClear will allocate a clear memory block from a
  317.         render-memhandler, or from public memory. If there is no memory
  318.         block of the requested size available, NULL will be returned.
  319.         You must check this return value. The request may fail at any
  320.         time. Any call to this function must be followed by a call to
  321.         FreeRenderVec(). AllocRenderVecClear() keeps track of the
  322.         allocated size and the memhandler itself.
  323.  
  324.    INPUTS
  325.         rendermemhandler - pointer to a render-memhandler, or NULL.
  326.                            If you pass NULL, MEMF_ANY will be used.
  327.         size             - the size of the desired block in bytes
  328.  
  329.    RESULTS
  330.         mem              - pointer to a block of memory filled with
  331.                            NULL bytes, or NULL if the allocation failed.
  332.  
  333.    SEE ALSO
  334.         FreeRenderVec(), AllocRenderVec(), AllocRenderMem(),
  335.         CreateRMHandlerA()
  336.  
  337.  
  338. render.library/ApplyAlphaChannelA           render.library/ApplyAlphaChannelA
  339.  
  340.    NAME
  341.         ApplyAlphaChannelA - compose RGB array via alpha-channel.
  342.         ApplyAlphaChannel  - varargs stub for ApplyAlphaChannelA.
  343.  
  344.    SYNOPSIS
  345.         ApplyAlphaChannelA(sourcearray,width,height,destarray,tags)
  346.                            a0          d0    d1     a1        a2
  347.  
  348.         void ApplyAlphaChannelA(ULONG *,UWORD,UWORD,ULONG *,
  349.                                 struct TagItem *)
  350.  
  351.         void ApplyAlphaChannel(ULONG *,UWORD,UWORD,ULONG *,
  352.                                tag,...,TAG_DONE)
  353.  
  354.    FUNCTION
  355.         This function uses the alpha-channel information (by default taken
  356.         from the source array) to perform a composition of the source and
  357.         destination array. The result will be written to the
  358.         destination array.
  359.  
  360.    INPUTS
  361.         sourcearray         - pointer to an ARGB array
  362.         width               - width [pixels]
  363.         height              - height [rows]
  364.         destarray           - pointer to a RGB array
  365.         taglist             - pointer to an array of TagItems
  366.  
  367.    TAGS
  368.         RND_SourceWidth (UWORD) - Total width of the source array [pixels].
  369.                 Default - equals to the specified width.
  370.  
  371.         RND_DestWidth (UWORD) - Total width of the dest array [pixels].
  372.                 Default - equals to the specified width.
  373.  
  374.         RND_AlphaChannel (ULONG) - Pointer to the alpha-channel array.
  375.                 Default - equals to the pointer to the source array.
  376.  
  377.         RND_AlphaModulo (UWORD) - Pixel offset that will be used when
  378.                 proceeding from one alpha-channel value to the next [bytes].
  379.                 Default - 4.
  380.  
  381.         RND_AlphaWidth (ULONG) - Total width of the alpha-channel array
  382.                 [pixels]. Default - equals to the specified width.
  383.  
  384.    RESULTS
  385.         none
  386.        
  387.    SEE ALSO
  388.         InsertAlphaChannelA(), ExtractAlphaChannelA(), MixAlphaChannelA()
  389.  
  390.  
  391. render.library/BestPen                                 render.library/BestPen
  392.  
  393.    NAME
  394.         BestPen - find the best matching pen.
  395.  
  396.    SYNOPSIS
  397.         pen = BestPen(palette,RGB)
  398.         d0            a0      d0
  399.         
  400.         LONG BestPen(APTR,ULONG)
  401.  
  402.    FUNCTION
  403.         Determine a palette's pen number that matches best a given RGB
  404.         value.
  405.  
  406.    INPUTS
  407.         palette   - palette created with CreatePaletteA()
  408.         RGB       - RGB value to find a match for
  409.  
  410.    RESULTS
  411.         pen       - pen number or -1 if no pen could be found.
  412.                     (Usually this occurs when the palette is empty.)
  413.  
  414.  
  415. render.library/Chunky2BitMapA                   render.library/Chunky2BitMapA
  416.  
  417.    NAME
  418.         Chunky2BitMapA - convert chunky data to bitplanes.
  419.         Chunky2BitMap  - varargs stub for Chunky2BitMapA.
  420.  
  421.    SYNOPSIS
  422.         Chunky2BitMapA(chunky,sx,sy,width,height,bitmap,dx,dy,taglist)
  423.                        a0     d0 d1 d2    d3     a1     d4 d5 a2
  424.         
  425.         void Chunky2BitMapA(UBYTE *,UWORD,UWORD,UWORD,UWORD,
  426.                             struct BitMap *,UWORD,UWORD,struct TagItem *)
  427.         
  428.         void Chunky2BitMap(UBYTE *,UWORD,UWORD,UWORD,UWORD,
  429.                            struct BitMap *,UWORD,UWORD,tag,...,TAG_DONE) 
  430.  
  431.    FUNCTION
  432.         Converts an array of chunky bytes to the bitplanes associated
  433.         with a BitMap structure. You can specify clip areas both inside
  434.         the chunky array and the BitMap. This function merges the data
  435.         into the destination BitMap if required. BMF_INTERLEAVED is also
  436.         handled.
  437.         
  438.         You may only process BMF_STANDARD bitmaps with this function.
  439.  
  440.    INPUTS
  441.         chunky     - pointer to an array of chunky bytes
  442.         sx         - left edge inside the chunky array [pixels]
  443.         sy         - top edge inside the chunky array [rows]
  444.         width      - width [pixels]
  445.         height     - height [rows]
  446.         bitmap     - pointer to an initialized BitMap structure
  447.         dx         - destination left edge inside BitMap [pixels]
  448.         dy         - destination top edge inside BitMap [rows]
  449.         taglist    - pointer to an array of TagItems
  450.  
  451.    TAGS
  452.         RND_SourceWidth (UWORD) - Total width of the chunky array [pixels].
  453.                 Default - equals to the specified width.
  454.  
  455.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  456.                 for a secondary conversion of the pen numbers.
  457.                 Default - NULL.
  458.  
  459.    RESULTS
  460.         none
  461.  
  462.    IMPORTANT NOTES
  463.         Starting with v39, you are not allowed to assume foreign BitMap
  464.         structures being of a planar type. You may pass a BitMap
  465.         structure to this function only if the BMF_STANDARD flag is set.
  466.  
  467.         Also remember to set-up your own BitMap structure with the
  468.         BMF_STANDARD flag if you wish to convert it with this function.
  469.         Consider Chunky2BitMapA() being low-level. The BitMap structure
  470.         involved here is intended to hold planar information. Since v39,
  471.         this is different to what graphics.library might associate with
  472.         a BitMap structure.
  473.  
  474.         Do not use this function with BitMap structures that are
  475.         actually being displayed. If you wish to transfer chunky bytes
  476.         to visible areas, use graphics.library functions, such as
  477.         WriteChunkyPixels(), or WritePixelArray8(). You may also use
  478.         Chunky2BitMapA() followed by BltBitMapRastPort() etc.
  479.  
  480.         With a graphics card supplied, WriteChunkyPixels() can be
  481.         hundereds times faster than Chunky2BitMapA() followed by
  482.         BltBitMapRastPort(). If you have to provide backward
  483.         compatibility, it is worth the effort to differenciate between
  484.         Kick 2.x and OS 3.x. Use Chunky2BitMapA() in the first case,
  485.         WritePixelArray8() in the second case, and WriteChunkyPixels()
  486.         if the system runs under OS3.1 and is supplied with a graphics
  487.         card.
  488.  
  489. SEE ALSO
  490.         Planar2ChunkyA(), graphics/gfx.h,
  491.         graphics.library/WriteChunkyPixels()
  492.  
  493.  
  494. render.library/Chunky2RGBA                         render.library/Chunky2RGBA
  495.  
  496.    NAME
  497.         Chunky2RGBA - convert an array of chunky bytes to RGB data.
  498.         Chunky2RGB  - varargs stub for Chunky2RGBA.
  499.  
  500.    SYNOPSIS
  501.         success = Chunky2RGBA(chunky,width,height,rgb,palette,taglist)
  502.         d0                    a0     d0    d1     a1  a2      a3
  503.         
  504.         ULONG Chunky2RGBA(UBYTE *,UWORD,UWORD,ULONG *,APTR,struct TagItem *)
  505.         
  506.         ULONG Chunky2RGB(UBYTE *,UWORD,UWORD,ULONG *,APTR,tag,...,TAG_DONE) 
  507.  
  508.    FUNCTION
  509.         This function converts an array of chunky bytes to RGB data.
  510.  
  511.    INPUTS
  512.         chunky      - pointer to an array of chunky bytes
  513.         width       - width to be converted [pixels]
  514.         height      - height to be converted [rows]
  515.         rgb         - pointer to RGB destination buffer
  516.         palette     - pointer to a palette created
  517.                       with CreatePaletteA()
  518.         taglist     - pointer to an array of TagItems
  519.  
  520.    TAGS
  521.         RND_SourceWidth (UWORD) - Total width of the chunky array [pixels].
  522.                 Default - equals to the specified width.
  523.  
  524.         RND_DestWidth (UWORD) - Total width of the RGB array [pixels].
  525.                 Default - equals to the specified width.
  526.  
  527.         RND_ColorMode (ULONG) - Color mode that defines how to determine
  528.                 a pixel's actual color. Valid types:
  529.  
  530.                 COLORMODE_CLUT          - normal palette lookup
  531.                 COLORMODE_HAM8          - HAM8 mode palette lookup
  532.                 COLORMODE_HAM6          - HAM6 mode palette lookup
  533.                 
  534.                 Default - COLORMODE_CLUT.
  535.  
  536.         RND_LeftEdge (UWORD) - Horizontal starting position inside the
  537.                 chunky array [pixels]. This is mainly intended to allow
  538.                 the conversion of HAM clip areas.
  539.                 Default - 0.
  540.  
  541.         RND_ProgressHook (ULONG) - Pointer to a callback hook
  542.                 structure for progress display operations. Refer to
  543.                 render/renderhooks.h for further information.
  544.                 Default - NULL.
  545.  
  546.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  547.                 for an additional conversion of the pen numbers.
  548.                 Default - NULL.
  549.                 Note: This is not defined for HAM modes.
  550.  
  551.         RND_LineHook (ULONG) - Pointer to a callback hook structure
  552.                 for line-related operations during conversion. This
  553.                 hook is executed once before a line is processed and
  554.                 once after it has been completed. Refer to
  555.                 render/renderhooks.h for further information.
  556.                 Default - NULL.
  557.  
  558.    RESULTS
  559.         success - CONV_SUCCESS to indicate that the operation
  560.                   succeeded. Currently, the only reason for this
  561.                   function to fail is CONV_CALLBACK_ABORTED.
  562.  
  563.    NOTES
  564.         - This function may call the progress callback Hook
  565.           with the PMSGTYPE_LINES_CONVERTED message type.
  566.  
  567.    SEE ALSO
  568.         render/render.h
  569.  
  570.  
  571. render.library/ChunkyArrayDiversityA     render.library/ChunkyArrayDiversityA
  572.  
  573.    NAME
  574.         ChunkyArrayDiversityA - calculate chunky array adaptibility
  575.         ChunkyArrayDiversity  - varargs stub for ChunkyArrayDiversityA.
  576.  
  577.    SYNOPSIS
  578.         diversity = ChunkyArrayDiversityA(chunkyarray,palette,
  579.         d0                                a0          a1
  580.                                           width,height,taglist)
  581.                                           d0    d1     a2
  582.  
  583.         LONG ChunkyArrayDiversityA(UBYTE *,APTR,UWORD,UWORD,
  584.                                    struct TagItem *)
  585.  
  586.         LONG ChunkyArrayDiversity(UBYTE *,UWORD,UWORD,
  587.                                   tag,...,TAG_DONE)
  588.  
  589.    FUNCTION
  590.         Calculate a chunky array's adaptibility to a palette or
  591.         mapping-engine.
  592.  
  593.    INPUTS
  594.         chunkyarray - pointer to an array of chunky bytes
  595.         palette     - the chunky array's palette
  596.         width       - width to be processed [pixels]
  597.         height      - height to be processed [pixels]
  598.         taglist     - pointer to an array of tagitems
  599.  
  600.    TAGS
  601.         RND_Palette (ULONG) - pointer to a palette. Either this or the
  602.                 RND_MapEngine argument is obligatory!
  603.  
  604.         RND_MapEngine (ULONG) - pointer to a mapping-engine. Either this
  605.                 or the RND_Palette argument is obligatory!
  606.  
  607.         RND_SourceWidth (UWORD) - Total width of the RGB array [pixels].
  608.                 Default - equals to the specified width.
  609.  
  610.         RND_Interleave (ULONG) - number of pixels to skip horizontally.
  611.                 Default - 0.
  612.  
  613.    RESULTS
  614.         diversity - an indicator for the chunky array's adaptibility
  615.                     to the given palette or mapping-engine. 0 indicates
  616.                     perfect adaptibility, 195075 indicates the worst case.
  617.  
  618.    IMPLEMENTATION   
  619.         Every color in the source array is adapted to the specified
  620.         palette or mapping-engine. Now assume p2 is the RGB of the
  621.         palette entry that matches best with the requested color p1.
  622.  
  623.             R
  624.             |
  625.             |      * p2
  626.             |     /
  627.             |    /
  628.             |   / d
  629.             |__/_________G
  630.            /  /
  631.           /  * p1
  632.          /
  633.         B
  634.  
  635.         This function sums up the diversity d² for every color in the
  636.         source array, and divides it by the number of pixels processed:
  637.  
  638.                           k=pixels
  639.                   1         ___
  640.         D   =   ------   .  \\  `   d(k)²
  641.                 pixels      /__,
  642.  
  643.                              k=1
  644.  
  645.         D is returned, so what you get is the average d² for all RGB
  646.         values that appear in the array. d² is summed up instead of d
  647.         because it is a better indicator for most purposes.
  648.  
  649.         Best case - all pixels match perfectly: D(min) = 0.
  650.         Worst case - all pixels are white, and the only available color
  651.         in the palette is black: D(max) = 255²+255²+255² = 195075.
  652.         
  653.    EXAMPLE        
  654.         D indicates a palette's applicability for the given chunky
  655.         array. You can e.g. use it to decide whether error diffusion
  656.         should be enabled for ConvertChunkyA().
  657.  
  658.         dithermode = DITHERMODE_NONE;
  659.  
  660.         D = ChunkyArrayDiversity(sourcearray, palette, width, height, 
  661.             RND_Palette, destpalette, RND_Interleave, 4, TAG_DONE);
  662.  
  663.         if (D > threshold)
  664.         {
  665.             dithermode = DITHERMODE_FS;
  666.         }
  667.  
  668.         ConvertChunky(sourcearray, palette, width, height, destarray,
  669.             destpalette, RND_DitherMode, dithermode, TAG_DONE);
  670.  
  671.         The interleave factor increases speed drastically. You gain a
  672.         lot of performance if only dithering can be avoided sometimes.
  673.  
  674.    SEE ALSO
  675.         RGBArrayDiversityA()
  676.  
  677.  
  678. render.library/ConvertChunkyA                   render.library/ConvertChunkyA
  679.  
  680.    NAME
  681.         ConvertChunkyA - convert an array of chunky bytes to a new palette.
  682.         ConvertChunky  - varargs stub for ConvertChunkyA.
  683.  
  684.    SYNOPSIS
  685.         success = ConvertChunkyA(source,sourcepalette,width,height,dest,        
  686.         d0                       a0     a1            d0    d1     a2   
  687.                                  destpalette,taglist)
  688.                                  a3          a4
  689.         
  690.         ULONG ConvertChunkyA(UBYTE *,APTR,UWORD,UWORD,UBYTE *,
  691.                              APTR,struct TagItem *)
  692.         
  693.         ULONG ConvertChunky(UBYTE *,APTR,UWORD,UWORD,UBYTE *,
  694.                             APTR,tag,...,TAG_DONE)
  695.  
  696.    FUNCTION
  697.         This function converts a source array of chunky bytes to another
  698.         chunky array, and adapts it to a new palette.
  699.  
  700.    INPUTS
  701.         source        - pointer to a source array of chunky bytes
  702.         sourcepalette - pointer to the source array's palette
  703.         width         - width to be converted [pixels]
  704.         height        - height to be converted [rows]
  705.         dest          - pointer to the destination chunky array
  706.         destpalette   - pointer to the destination array's palette
  707.         taglist       - pointer to an array of TagItems
  708.  
  709.    TAGS
  710.         RND_SourceWidth (UWORD) - Total width of source array [pixels].
  711.                 Default - equals to the specified width.
  712.  
  713.         RND_DestWidth (UWORD) - Total width of dest array [pixels].
  714.                 Default - equals to the specified width.
  715.  
  716.         RND_DitherMode (UWORD) - Error diffusion mode. Valid types:
  717.  
  718.                 DITHERMODE_NONE   - no error diffusion
  719.  
  720.                 DITHERMODE_FS     - Floyd-Steinberg
  721.                                     Does not handle a dither amount.
  722.  
  723.                 DITHERMODE_RANDOM - Random dithering
  724.                                     Handles RND_DitherAmount.
  725.  
  726.                 Default - DITHERMODE_NONE.
  727.  
  728.         RND_DitherAmount (UWORD) - Dither intensity (0-255).
  729.                 Only valid with certain dither modes (see above).
  730.                 Default - 128.
  731.  
  732.         RND_LineHook (ULONG) - Pointer to a callback hook structure
  733.                 for line-related operations during conversion. This
  734.                 hook is executed once before a line is rendered and
  735.                 once after a line has been completed. Refer to
  736.                 render/renderhooks.h for further information.
  737.                 Default - NULL.
  738.  
  739.         RND_OffsetColorZero (UWORD) - First pen number to appear
  740.                 in the rendered chunky image. This offset will be
  741.                 added to the palette's indices. Default - 0.
  742.                 Note: RND_PenTable overrides RND_OffsetColorZero.
  743.  
  744.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  745.                 for a secondary conversion of the pen numbers.
  746.                 Default - NULL.
  747.                 Note: RND_PenTable overrides RND_OffsetColorZero.
  748.  
  749.         RND_ProgressHook (ULONG) - Pointer to a callback hook
  750.                 structure for progress display operations. Refer to
  751.                 render/renderhooks.h for further information.
  752.                 Default - NULL.
  753.  
  754.         RND_ScaleEngine (ULONG) - Pointer to a scaling-engine.
  755.                 This scaling-engine will be used to scale the
  756.                 source data stream before it is being rendered.
  757.                 Default - NULL.
  758.  
  759.                 Notes: 
  760.                 - The scaling engine's destination width and
  761.                   height specifications override the width and
  762.                   height arguments for RenderA().
  763.                 - The scaling-engine must have been created with
  764.                   PIXFMT_CHUNKY_CLUT.
  765.  
  766.         RND_MapEngine (ULONG) - Pointer to a mapping-engine.
  767.                 This can greatly improve performance.
  768.                 Default - NULL.
  769.                 
  770.                 Notes:
  771.                 - The mapping-engine must have been created for
  772.                   the destination palette that is specified for
  773.                   ConvertChunkyA().
  774.                 - With dithering enabled, you better do not
  775.                   specify a mapping-engine which was created with
  776.                   a link to a histogram. Accurate conversion could
  777.                   not be guaranteed in this case.
  778.  
  779.    RESULTS
  780.         success - returncode to indicate whether the operation
  781.                   succeeded. You must at least check for
  782.                   CONV_SUCCESS.
  783.  
  784.    NOTES
  785.         - This function may call the progress callback Hook with
  786.           the PMSGTYPE_LINES_CONVERTED message type.
  787.         
  788.    SEE ALSO
  789.         MapChunkyArrayA(), RenderA(), CreatePenTableA(),
  790.         CreatePaletteA(), render/render.h, render/renderhooks.h
  791.  
  792.  
  793. render.library/CountRGB                               render.library/CountRGB
  794.  
  795.    NAME
  796.         CountRGB     - count a RGB value in a histogram.
  797.  
  798.    SYNOPSIS
  799.         count = CountRGB(histogram,RGB)
  800.         d0               a0        d0
  801.         
  802.         ULONG CountRGB(APTR,ULONG)
  803.  
  804.    FUNCTION
  805.         Counts the number of occurances for a given RGB value. The
  806.         result may depend on the histogram's accuracy.
  807.  
  808.    INPUTS
  809.         histogram - pointer to a histogram
  810.  
  811.    RESULTS
  812.         count     - number of representations for the
  813.                     specified RGB value.
  814.  
  815.    NOTE
  816.         You only get the exact result for 24bit histograms. The lower
  817.         the resolution, the more colors are actually put together into
  818.         one `category' of similar colors. A 24bit histogram
  819.         differenciates 16,7 million colors, a 15bit histogram, for
  820.         instance, only 32768.
  821.  
  822.  
  823. render.library/CreateAlphaArrayA             render.library/CreateAlphaArrayA
  824.  
  825.    NAME
  826.         CreateAlphaArrayA - create an alpha-channel for a RGB array.
  827.         CreateAlphaArray  - varargs stub for CreateAlphaArrayA.
  828.  
  829.    SYNOPSIS
  830.         CreateAlphaArrayA(rgbarray,width,height,tags)
  831.                           a0       d0    d1     a1
  832.  
  833.         void CreateAlphaArrayA(ULONG *,UWORD,UWORD,struct TagItem *)
  834.  
  835.         void CreateAlphaArray(ULONG *,UWORD,UWORD,tag,...,TAG_DONE)
  836.  
  837.    FUNCTION
  838.         This function creates an alpha-channel for the given RGB array.
  839.         The alpha-channel will be the difference in brightness towards
  840.         black (0x000000), or optionally towards another RGB value.
  841.  
  842.    INPUTS
  843.         rgbarray            - pointer to a RGB array
  844.         width               - width [pixels]
  845.         height              - height [rows]
  846.         taglist             - pointer to an array of TagItems
  847.  
  848.    TAGS
  849.         RND_SourceWidth (UWORD) - Total width of the RGB array [pixels].
  850.                 Default - equals to the specified width.
  851.  
  852.         RND_AlphaChannel (ULONG) - Alpha-channel destination array.
  853.                 Default - equals to rgbarray. the upmost byte in the
  854.                 RGB array is a good place for an alpha-channel, usually.
  855.  
  856.         RND_AlphaWidth (UWORD) - Total width of the alpha-channel array
  857.                 [pixels]. Default - equals to the specified width.
  858.  
  859.         RND_AlphaModulo (UWORD) - Alpha-channel pixel modulo [bytes].
  860.                 Default - 4
  861.                 
  862.         RND_MaskRGB (ULONG) - The RGB value to compute the alpha-channel
  863.                 towards. Default - 0x000000
  864.  
  865.    RESULTS
  866.         none
  867.  
  868.  
  869. render.library/CreateHistogramA               render.library/CreateHistogramA
  870.  
  871.    NAME
  872.         CreateHistogramA - create and set up a histogram.
  873.         CreateHistogram  - varargs stub for CreateHistogramA.
  874.  
  875.    SYNOPSIS
  876.         hst = CreateHistogramA(taglist)
  877.         d0                     a1
  878.         
  879.         APTR CreateHistogramA(struct TagItem *)
  880.         
  881.         APTR CreateHistogram(tag,...,TAG_DONE)
  882.  
  883.    FUNCTION
  884.         Allocates and initializes a histogram.
  885.  
  886.    INPUTS
  887.         taglist - pointer to an array of TagItems
  888.  
  889.    TAGS
  890.         RND_RMHandler (ULONG) - pointer to a render-memhandler
  891.                 created with CreateRMHandlerA().
  892.                 Default - NULL.
  893.  
  894.         RND_HSType (UWORD) - Type of histogram. Valid types:
  895.  
  896.                 HSTYPE_12BIT            - 12bit dynamic histogram
  897.                 HSTYPE_15BIT            - 15bit dynamic histogram
  898.                 HSTYPE_18BIT            - 18bit dynamic histogram
  899.                 HSTYPE_21BIT            - 21bit dynamic histogram
  900.                 HSTYPE_24BIT            - 24bit dynamic histogram
  901.                 HSTYPE_12BIT_TURBO      - 12bit tabular histogram
  902.                 HSTYPE_15BIT_TURBO      - 15bit tabular histogram
  903.                 HSTYPE_18BIT_TURBO      - 18bit tabular histogram
  904.  
  905.                 Default - HSTYPE_15BIT_TURBO.
  906.  
  907.    RESULTS
  908.         histogram - pointer to a histogram ready for usage,
  909.                     or NULL if something went wrong.
  910.  
  911.    SEE ALSO
  912.         DeleteHistogram(), QueryHistogram(), render/render.h
  913.  
  914.  
  915. render.library/CreateMapEngineA               render.library/CreateMapEngineA
  916.  
  917.    NAME
  918.         CreateMapEngineA - create a mapping-engine.
  919.         CreateMapEngine - varargs stub for CreateMappingEngineA.
  920.  
  921.    SYNOPSIS
  922.         engine = CreateMapEngineA(palette,taglist)
  923.         d0                        a0       a1
  924.  
  925.         ULONG CreateMapEngineA(APTR,struct TagItem *)
  926.         
  927.         ULONG CreateMapEngine(APTR,tag,...,TAG_DONE)
  928.  
  929.   FUNCTION
  930.         This function will create and prepare a mapping-engine for
  931.         usage. Mapping-engines are highly optimized low-level conversion
  932.         units for rendering to a specific palette.
  933.  
  934.         Mapping-engines are immediately dependent from a palette, and
  935.         they may be additionally coupled with a histogram. In the latter
  936.         case, mapping-engines adapt only RGB values that can be found in
  937.         the histogram.
  938.  
  939.         Mapping-engines do not incorporate the contents of their
  940.         palettes and histograms. They are getting notified, and they
  941.         automagically update themselves when needed. This update takes
  942.         place only on demand, i.e. whenever you pass a mapping-engine to
  943.         a function. The mapping-engine checks if any changes applied to
  944.         the palette or histogram, and it reconstructs itself. The
  945.         palette's pen-adaption buffers are updated as well - palettes
  946.         and mapping-engines are just good friends.
  947.  
  948.    INPUTS
  949.         palette       - pointer to a palette
  950.         taglist       - pointer to an array of TagItems
  951.  
  952.    TAGS
  953.         RND_RMHandler (ULONG) - Pointer to a render-memhandler.
  954.                 This will be used for the mapping-engine's
  955.                 buffers. Default - The palette's memhandler.
  956.    
  957.         RND_Histogram (ULONG) - Pointer to a histogram.
  958.                 The histogram must be of a HSTYPE_..._TURBO type,
  959.                 and have the same resolution as the palette.
  960.                 Default - none.
  961.  
  962.    RESULTS
  963.         engine - pointer to a mapping-engine ready for usage,
  964.                  or NULL if something went wrong.
  965.  
  966.    NOTES
  967.         You must free a mapping-engine before you DeletePalette() the
  968.         palette it is dependent from. The same applies for the
  969.         histogram.
  970.  
  971.    SEE ALSO
  972.         DeleteMapEngine(), MapRGBArrayA(), CreateRMHandlerA()
  973.  
  974.  
  975. render.library/CreatePaletteA                   render.library/CreatePaletteA
  976.  
  977.    NAME
  978.         CreatePaletteA - create a palette.
  979.         CreatePalette  - vararg stub for CreatePaletteA.
  980.  
  981.    SYNOPSIS
  982.         palette = CreatePaletteA(taglist)
  983.         d0                       a1
  984.         
  985.         APTR CreatePaletteA(struct TagItem *)
  986.         
  987.         APTR CreatePalette(tag,...,TAG_DONE)
  988.  
  989.    FUNCTION
  990.         This function creates and initializes a palette that can hold up
  991.         to 256 color entries.
  992.  
  993.    INPUTS
  994.         taglist     - pointer to an array of TagItems
  995.  
  996.    TAGS
  997.         RND_HSType (ULONG) - the palette's resolution. Palette adaption
  998.                 accuracy and memory consumption depend on this constant.
  999.                 A palette's resolution is specified analogously to a
  1000.                 histogram's resolution. Valid types:
  1001.  
  1002.                 HSTYPE_12BIT
  1003.                 HSTYPE_15BIT
  1004.                 HSTYPE_18BIT
  1005.  
  1006.                 Default - HSTYPE_15BIT.
  1007.  
  1008.         RND_RMHandler (ULONG) - pointer to a render-memhandler that was
  1009.                 created with CreateRMHandler(). Default - NULL.
  1010.         
  1011.    RESULTS
  1012.         palette  - a palette ready for usage,
  1013.                    or NULL if something went wrong.
  1014.  
  1015.    SEE ALSO
  1016.         DeletePalette(), ImportPaletteA(), ExportPaletteA(), 
  1017.         ExtractPaletteA(), FlushPalette(), render/render.h
  1018.  
  1019.  
  1020. render.library/CreatePenTableA                 render.library/CreatePenTableA
  1021.  
  1022.    NAME
  1023.         CreatePenTableA - create a pen conversion table.
  1024.         CreatePenTable  - varargs stub for CreatePenTableA.
  1025.  
  1026.    SYNOPSIS
  1027.         CreatePenTableA(chunky,oldpalette,width,height,newpalette,
  1028.                         a0     a1         d0    d1     a2
  1029.                         pentab,taglist)
  1030.                         a3     a4
  1031.         
  1032.         void CreatePenTableA(UBYTE *,APTR,UWORD,UWORD,APTR,
  1033.                              UBYTE *,struct TagItem *)
  1034.         
  1035.         void CreatePenTable(UBYTE *,APTR,UWORD,UWORD,APTR,
  1036.                             UBYTE *,tag,...,TAG_DONE)
  1037.  
  1038.    FUNCTION
  1039.         This function creates a table for the conversion of a particular
  1040.         array of chunky bytes. It scans through the chunky array, adapts
  1041.         the found palette entries to a new palette, and generates an
  1042.         output table of 256 UBYTEs. The resulting table is handled as
  1043.         follows:
  1044.  
  1045.         new_pen_number = pentab[old_pen_number]
  1046.         
  1047.    INPUTS
  1048.         chunky      - pointer to an array of chunky bytes
  1049.         oldpalette  - pointer to the original palette
  1050.         width       - width to be processed [pixels]
  1051.         height      - height to be processed [rows]
  1052.         newpalette  - pointer to a palette to be adapted to
  1053.         pentab      - pointer to the destination table
  1054.         taglist     - pointer to an array of TagItems
  1055.  
  1056.    TAGS
  1057.         RND_SourceWidth (UWORD) - Total width of the chunky array [pixels].
  1058.                 Default - equals to the specified width.
  1059.  
  1060.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  1061.                 for a secondary conversion of the pen numbers.
  1062.                 Default - NULL.
  1063.         
  1064.    RESULTS
  1065.         none
  1066.         
  1067.    NOTES
  1068.         The destination table is assumed to have 256 entries,
  1069.         with no respect to what color indices actually occur in
  1070.         the chunky array.
  1071.  
  1072.    SEE ALSO
  1073.         ConvertChunkyA(), CreatePaletteA()
  1074.  
  1075.  
  1076. render.library/CreateRMHandlerA               render.library/CreateRMHandlerA
  1077.  
  1078.    NAME
  1079.         CreateRMHandlerA - Create and set up a memory handler.
  1080.         CreateRMHandler  - varargs stub for CreateRMHandlerA.
  1081.  
  1082.    SYNOPSIS
  1083.         rmh = CreateRMHandlerA(taglist)
  1084.         d0                     a1
  1085.         
  1086.         APTR CreateRMHandlerA(struct TagItem *)
  1087.         
  1088.         APTR CreateRMHandler(tag,...,TAG_DONE)
  1089.  
  1090.    FUNCTION
  1091.         This function allocates and initializes a render-memhandler.
  1092.         This is a custom memory resource manager for histograms,
  1093.         rendering, palettes, and many other render.library
  1094.         objects and functions. You may use a render-memhandler for your
  1095.         own purposes, too.
  1096.  
  1097.         A render-memhandler helps to avoid memory fragmentation as well
  1098.         as extreme stressing of the system's public memory lists.
  1099.         Private memory management is supported as well as v39 exec pools
  1100.         and common public memory. Future versions might provide more
  1101.         types of memory management.
  1102.  
  1103.    INPUTS
  1104.         taglist - pointer to an array of TagItems
  1105.  
  1106.    TAGS
  1107.         RND_MemType (UWORD) - type of memory management. Valid types:
  1108.  
  1109.                 RMHTYPE_POOL            - v39 exec dynamic pool
  1110.                 RMHTYPE_PRIVATE         - you supply a private memory pool
  1111.                 RMHTYPE_PUBLIC          - use common public memory
  1112.  
  1113.                 Default - RMHTYPE_PUBLIC.
  1114.  
  1115.         RND_MemBlock (ULONG) - pointer to a block of memory
  1116.                 used for private memory management. This tag
  1117.                 is obligatory if you specify RMHTYPE_PRIVATE
  1118.                 and is ignored otherwise. 
  1119.                 Default - none.
  1120.  
  1121.         RND_MemSize (ULONG) - size of the memory block used
  1122.                 for private memory management. This tag is
  1123.                 obligatory if you specify RMHTYPE_PRIVATE
  1124.                 and is ignored otherwise. 
  1125.                 Default - none.
  1126.  
  1127.         RND_MemFlags (ULONG) - memory flags, as defined in
  1128.                 exec/memory.h. These are ignored for
  1129.                 RMHTYPE_PRIVATE. Default - MEMF_ANY.
  1130.  
  1131.    RESULTS
  1132.         rmh - a render-memhandler ready for usage, or NULL if
  1133.               something went wrong.
  1134.  
  1135.    NOTES
  1136.         You must check for the presence of exec v39 before you create a
  1137.         memhandler with RMHTYPE_POOL specified.
  1138.  
  1139.    SEE ALSO
  1140.         AllocRenderMem(), AllocRenderVec(), DeleteRMHandler(),
  1141.         exec.library/CreatePool(), render/render.h, exec/memory.h
  1142.  
  1143.  
  1144. render.library/CreateScaleEngineA           render.library/CreateScaleEngineA
  1145.  
  1146.    NAME
  1147.         CreateScaleEngineA - Create a scaling-engine.
  1148.         CreateScaleEngine  - varargs stub for CreateScaleEngineA.
  1149.  
  1150.    SYNOPSIS
  1151.         scaleengine = CreateScaleEngineA(sourcewidth,sourceheight,
  1152.         d0                               d0          d1           
  1153.                                          destwidth,destheight,taglist)
  1154.                                          d2        d3         a1
  1155.         
  1156.         APTR CreateScaleEngineA(UWORD,UWORD,UWORD,
  1157.                                 UWORD,struct TagItem *)
  1158.         
  1159.         APTR CreateScaleEngine(UWORD,UWORD,UWORD,
  1160.                                UWORD,tag,...,TAG_DONE)
  1161.  
  1162.    FUNCTION
  1163.         Allocates and initializes a scaling-engine for a specific set of
  1164.         scaling parameters. Once set up, a scaling-engine is highly
  1165.         optimized for its particular parameter specifications.
  1166.  
  1167.    INPUTS
  1168.         sourcewidth  - source width [pixels]
  1169.         sourceheight - source height [rows]
  1170.         destwidth    - destination width [pixels]
  1171.         destheight   - destination height [rows]
  1172.         taglist      - pointer to an array of tag items
  1173.  
  1174.    TAGS
  1175.         RND_RMHandler (ULONG) - pointer to a render-memhandler,
  1176.                 such as created with CreateRMHandlerA().
  1177.                 Default - NULL.
  1178.  
  1179.         RND_PixelFormat (ULONG) - Type of data to process.
  1180.                 Currently defined are PIXFMT_CHUNKY_CLUT
  1181.                 and PIXFMT_0RGB_32. Default - PIXFMT_CHUNKY_CLUT.
  1182.  
  1183.    RESULTS
  1184.         engine - a scaling-engine ready for usage, or NULL
  1185.                  if something went wrong.
  1186.  
  1187.    SEE ALSO
  1188.         DeleteScaleEngine(), ScaleA()
  1189.  
  1190.  
  1191. render.library/DeleteHistogram                 render.library/DeleteHistogram
  1192.  
  1193.    NAME
  1194.         DeleteHistogram - dispose a histogram.
  1195.  
  1196.    SYNOPSIS
  1197.         DeleteHistogram(histogram)
  1198.                         a0
  1199.  
  1200.         void DeleteHistogram(APTR)
  1201.  
  1202.    FUNCTION
  1203.         Removes a histogram and frees all associated memory.
  1204.  
  1205.    INPUTS
  1206.         histogram   - pointer to a histogram
  1207.                       Passing a NULL pointer is safe.
  1208.  
  1209.    RESULTS
  1210.         none
  1211.  
  1212.  
  1213. render.library/DeleteMapEngine                 render.library/DeleteMapEngine
  1214.  
  1215.    NAME
  1216.         DeleteMapEngine - dispose a mapping-engine.
  1217.  
  1218.    SYNOPSIS
  1219.         DeleteMapEngine(engine)
  1220.                         a0
  1221.  
  1222.         void DeleteMapEngine(APTR)
  1223.  
  1224.    FUNCTION
  1225.         Removes a mapping-engine and frees all associated memory.
  1226.  
  1227.    INPUTS
  1228.         engine   - pointer to a mapping-engine
  1229.  
  1230.    NOTES
  1231.         You must free mapping-engines before you delete the
  1232.         palettes and histograms they're dependent from.
  1233.  
  1234.    RESULTS
  1235.         none
  1236.  
  1237.    SEE ALSO
  1238.         CreateMapEngine()
  1239.  
  1240.  
  1241. render.library/DeleteRMHandler                 render.library/DeleteRMHandler
  1242.  
  1243.    NAME
  1244.         DeleteRMHandler - free a render-memhandler.
  1245.  
  1246.    SYNOPSIS
  1247.         DeleteRMHandler(rendermemhandler)
  1248.                         a0
  1249.  
  1250.         void DeleteRMHandler(APTR)
  1251.  
  1252.    FUNCTION
  1253.         DeleteRMHandler() will remove and free a previously created
  1254.         render-memhandler. That does not imply that any outstanding
  1255.         memory will be returned to the system or to whatever memory
  1256.         ressources. You are responsible for freeing each memory block
  1257.         that you have allocated from a render-memhandler.
  1258.  
  1259.    INPUTS
  1260.         render-memhandler - a render-memhandler to be deleted.
  1261.  
  1262.    RESULTS
  1263.         none
  1264.  
  1265.    NOTES
  1266.         You are not allowed to call DeleteRMHandler() before every
  1267.         single byte has been returned to the memhandler.
  1268.  
  1269.    SEE ALSO
  1270.         CreateRMHandlerA()
  1271.  
  1272.  
  1273. render.library/DeletePalette                     render.library/DeletePalette
  1274.  
  1275.    NAME
  1276.         DeletePalette - dispose a palette.
  1277.  
  1278.    SYNOPSIS
  1279.         DeletePalette(palette)
  1280.                       a0
  1281.  
  1282.         void DeletePalette(APTR)
  1283.  
  1284.    FUNCTION
  1285.         This function deletes a palette and frees all
  1286.         associated memory.
  1287.  
  1288.    INPUTS
  1289.         palette   - pointer to a palette created
  1290.                     with CreatePaletteA()
  1291.  
  1292.    RESULTS
  1293.         none
  1294.  
  1295.    SEE ALSO
  1296.         CreatePaletteA(), FlushPalette()
  1297.  
  1298.  
  1299. render.library/DeleteScaleEngine             render.library/DeleteScaleEngine
  1300.  
  1301.    NAME
  1302.         DeleteScaleEngine - dispose a scaling-engine.
  1303.  
  1304.    SYNOPSIS
  1305.         DeleteScaleEngine(engine)
  1306.                           a0
  1307.  
  1308.         void DeleteScaleEngine(APTR)
  1309.  
  1310.    FUNCTION
  1311.         Deletes a scaling-engine and frees all associated memory.
  1312.  
  1313.    INPUTS
  1314.         engine   - a scaling-engine to be removed
  1315.  
  1316.    RESULTS
  1317.         none
  1318.  
  1319.    SEE ALSO
  1320.         CreateScaleEngineA()
  1321.  
  1322.  
  1323. render.library/ExportPaletteA                   render.library/ExportPaletteA
  1324.  
  1325.    NAME
  1326.         ExportPaletteA - export a palette.
  1327.         ExportPalette  - varargs stub for ExportPaletteA.
  1328.  
  1329.    SYNOPSIS
  1330.         ExportPaletteA(palette,buffer,taglist)
  1331.                        a0      a1     a2
  1332.         
  1333.         ExportPaletteA(APTR,APTR,struct TagItem *)
  1334.         
  1335.         ExportPalette(APTR,APTR,tag,...,TAG_DONE)
  1336.  
  1337.    FUNCTION
  1338.         This function exports a palette (or a part of it)
  1339.         to a colortable.
  1340.  
  1341.    INPUTS
  1342.         palette   - pointer to a palette created
  1343.                     with CreatePaletteA()
  1344.         buffer    - pointer to a destination buffer
  1345.         taglist   - pointer to an array of tag items
  1346.  
  1347.    TAGS
  1348.         RND_PaletteFormat (ULONG) - format of the color table
  1349.                 to be exported. Valid types:
  1350.  
  1351.                 PALFMT_RGB32    - ULONG red,green,blue
  1352.                 PALFMT_RGB8     - ULONG 0x00rrggbb
  1353.                 PALFMT_RGB4     - UWORD 0xrgb
  1354.  
  1355.                 Default - PALFMT_RGB8.
  1356.  
  1357.         RND_FirstColor (ULONG) - first color entry to export.
  1358.                 Default - 0.
  1359.         
  1360.         RND_NumColors (ULONG) - number of colors to export.
  1361.                 Default - the number of colors inside the palette.
  1362.  
  1363.    RESULTS
  1364.         none
  1365.  
  1366.    SEE ALSO
  1367.         CreatePaletteA(), ImportPaletteA()
  1368.  
  1369.  
  1370. render.library/ExtractAlphaChannelA       render.library/ExtractAlphaChannelA
  1371.  
  1372.    NAME
  1373.         ExtractAlphaChannelA - extract alpha-channel from an ARGB array.
  1374.         ExtractAlphaChannel  - varargs stub for ExtractAlphaChannelA.
  1375.  
  1376.    SYNOPSIS
  1377.         ExtractAlphaChannelA(argbarray,width,height,chunkyarray,tags)
  1378.                              a0       d0    d1     a1          a2
  1379.  
  1380.         void ExtractAlphaChannelA(ULONG *,UWORD,UWORD,UBYTE *,
  1381.                                   struct TagItem *)
  1382.  
  1383.         void ExtractAlphaChannel(ULONG *,UWORD,UWORD,UBYTE *,
  1384.                                  tag,...,TAG_DONE)
  1385.  
  1386.    FUNCTION
  1387.         This function extracts the alpha-channel mask from an ARGB array
  1388.         and writes it to an array of chunky bytes.
  1389.  
  1390.    INPUTS
  1391.         argbarray           - pointer to an ARGB array
  1392.         width               - width [pixels]
  1393.         height              - height [rows]
  1394.         chunkyarray         - pointer to an array of chunky bytes
  1395.         taglist             - pointer to an array of TagItems
  1396.  
  1397.    TAGS
  1398.         RND_SourceWidth (UWORD) - Total width of the ARGB array [pixels].
  1399.                 Default - equals to the specified width.
  1400.  
  1401.         RND_DestWidth (UWORD) - Total width of the chunky array [pixels].
  1402.                 Default - equals to the specified width.
  1403.  
  1404.    RESULTS
  1405.         none
  1406.        
  1407.    SEE ALSO
  1408.         InsertAlphaChannelA(), ApplyAlphaChannelA()
  1409.  
  1410.  
  1411. render.library/ExtractPaletteA                 render.library/ExtractPaletteA
  1412.  
  1413.    NAME
  1414.         ExtractPaletteA - extract a palette from a histogram.
  1415.         ExtractPalette  - varargs stub for ExtractPaletteA.
  1416.  
  1417.    SYNOPSIS
  1418.         success = ExtractPaletteA(histogram,palette,numcolors,taglist)
  1419.         d0                        a0        a1      d0        a2
  1420.         
  1421.         ULONG ExtractPaletteA(APTR,ULONG *,UWORD,struct TagItem *)
  1422.         
  1423.         ULONG ExtractPalettA(APTR,ULONG *,UWORD,tag,...,TAG_DONE)
  1424.  
  1425.    FUNCTION
  1426.         This function extracts a given number of colors from a
  1427.         histogram and stores it in a palette.
  1428.  
  1429.    INPUTS
  1430.         histogram - pointer to a histogram
  1431.         palette   - pointer to a palette created
  1432.                     with CreatePaletteA()
  1433.         numcolors - number of entries to extract
  1434.         taglist   - pointer to an array of TagItems
  1435.  
  1436.    TAGS
  1437.         RND_RMHandler (ULONG) - Custom memory handler created with
  1438.                 CreateRMHandlerA(). This is used to handle intermediate
  1439.                 buffers during quantization.
  1440.                 Default - The histogram's memory handler.
  1441.  
  1442.         RND_ProgressHook (ULONG) - Pointer to a callback hook
  1443.                 structure for progress display operations. Refer to
  1444.                 render/renderhooks.h for further information.
  1445.                 Default - NULL.
  1446.  
  1447.         RND_RGBWeight (ULONG) - R/G/B quantization factors.
  1448.                 They form a relative measurement between the R/G/B
  1449.                 components, defining what color components should be
  1450.                 preferred when the histogram gets decomposed.
  1451.                 Default - 0x010101 (all components are treat equally).
  1452.  
  1453.         RND_ColorMode (ULONG) - Color mode that defines how to determine
  1454.                 a pixel's actual color. Currently this tag should only be
  1455.                 set to COLORMODE_HAM6 if you extract a palette for the
  1456.                 use with a HAM6 image. 
  1457.                 Default - COLORMODE_CLUT.
  1458.  
  1459.         RND_FirstColor (ULONG) - first color entry inside the palette
  1460.                 that will be used for the extracted colors. See also
  1461.                 ImportPaletteA() for further details. Default - 0.
  1462.  
  1463.         RND_NewPalette (ULONG) - if set to TRUE, this flag indicates
  1464.                 that you want to dispose the current palette and
  1465.                 create a new one. If set to FALSE, the new color entries
  1466.                 are merged to the existing palette. Default - TRUE.
  1467.  
  1468.    RESULTS
  1469.         success - returncode to indicate whether the operation
  1470.                   succeeded. You must at least check for
  1471.                   EXTP_SUCCESS.
  1472.  
  1473.    NOTES
  1474.         - This function may call the progress callback Hook
  1475.           with the PMSGTYPE_COLORS_CHOSEN message type.
  1476.  
  1477.    SEE ALSO
  1478.         CreateHistogramA(), CreatePaletteA(), ImportPaletteA(),
  1479.         render/render.h, render/renderhooks.h
  1480.  
  1481.  
  1482. render.library/FlushPalette                       render.library/FlushPalette
  1483.  
  1484.    NAME
  1485.         FlushPalette - flush all buffers from a palette.
  1486.  
  1487.    SYNOPSIS
  1488.         FlushPalette(palette)
  1489.                      a0
  1490.  
  1491.         void FlushPalette(APTR)
  1492.  
  1493.    FUNCTION
  1494.         This function flushes all buffers that might be
  1495.         associated with a palette.
  1496.  
  1497.    INPUTS
  1498.         palette   - pointer to a palette that was
  1499.                     created with CreatePaletteA()
  1500.  
  1501.    RESULTS
  1502.         none
  1503.  
  1504.    SEE ALSO
  1505.         DeletePalette()
  1506.  
  1507.  
  1508. render.library/FreeRenderMem                     render.library/FreeRenderMem
  1509.  
  1510.    NAME
  1511.         FreeRenderMem - return memory to a render-memhandler.
  1512.  
  1513.    SYNOPSIS
  1514.         FreeRenderMem(rendermemhandler,mem,size)
  1515.                       a0               a1  d0
  1516.  
  1517.         void FreeRenderMem(APTR,APTR,ULONG)
  1518.  
  1519.    FUNCTION
  1520.         Free a block of memory that was allocated with
  1521.         AllocRenderMem().
  1522.  
  1523.    INPUTS
  1524.         rendermemhandler - pointer to the render-memhandler the block
  1525.                            has been allocated from
  1526.         mem              - pointer to the memory block to be returned
  1527.         size             - size of that memory block [bytes]
  1528.  
  1529.    RESULTS
  1530.         NONE
  1531.  
  1532.    SEE ALSO
  1533.         AllocRenderMem(), CreateRMHandlerA()
  1534.  
  1535.  
  1536. render.library/FreeRenderVec                     render.library/FreeRenderVec
  1537.  
  1538.    NAME
  1539.         FreeRenderVec - return memory to a render-memhandler.
  1540.  
  1541.    SYNOPSIS
  1542.         FreeRenderVec(mem)
  1543.                       a0
  1544.  
  1545.         void FreeRenderVec(APTR)
  1546.  
  1547.    FUNCTION
  1548.         Free a block of memory that was allocated with AllocRenderVec().
  1549.  
  1550.    INPUTS
  1551.         mem - pointer to a memory block
  1552.               to be returned to its render-memhandler.
  1553.               Passing a NULL pointer is safe.
  1554.  
  1555.    RESULTS
  1556.         NONE
  1557.  
  1558.    SEE ALSO
  1559.         AllocRenderVec(), DeleteRMHandler()
  1560.  
  1561.  
  1562. render.library/ImportPaletteA                   render.library/ImportPaletteA
  1563.  
  1564.    NAME
  1565.         ImportPaletteA - import a palette.
  1566.         ImportPalette  - varargs stub for ImportPaletteA.
  1567.  
  1568.    SYNOPSIS
  1569.         ImportPaletteA(palette,table,entries,taglist)
  1570.                        a0      a1    d0      a2
  1571.         
  1572.         ImportPaletteA(APTR,APTR,UWORD,struct TagItem *)
  1573.         
  1574.         ImportPalette(APTR,APTR,UWORD,tag,...,TAG_DONE)
  1575.         
  1576.    FUNCTION
  1577.         This function imports entries from a color table (or from a
  1578.         palette) to a palette. You are allowed to import multiple times.
  1579.         When doing so, entries will be overwritten (not inserted). The
  1580.         palette automatically grows to the required number of entries.
  1581.         Remember to neither import more than 256 entries nor beyond the
  1582.         256th entry.
  1583.  
  1584.    INPUTS
  1585.         palette   - pointer to a palette created
  1586.                     with CreatePaletteA()
  1587.         table     - pointer to a source color table
  1588.                     (or a render.library palette)
  1589.         entries   - number of color entries to import
  1590.         taglist   - pointer to an array of tag items
  1591.  
  1592.    TAGS
  1593.         RND_PaletteFormat (ULONG) - format of the color table
  1594.                 to be imported. Valid types:
  1595.  
  1596.                 PALFMT_RGB32    - ULONG red,green,blue
  1597.                 PALFMT_RGB8     - ULONG 0x00rrggbb
  1598.                 PALFMT_RGB4     - UWORD 0xrgb
  1599.                 PALFMT_PALETTE  - another palette
  1600.  
  1601.                 Default - PALFMT_RGB8.
  1602.  
  1603.         RND_FirstColor (ULONG) - first color entry inside the
  1604.                 palette to import to. Default - 0.
  1605.  
  1606.         RND_EHBPalette (ULONG) - tag to indicate whether the
  1607.                 imported colors should be interpreted as for an
  1608.                 Extra-Halfbrite picture. Default - FALSE.
  1609.  
  1610.         RND_NewPalette (ULONG) - if set to TRUE, this flag indicates
  1611.                 that you want to dispose the current palette and
  1612.                 import a new one. If set to FALSE, the palette is
  1613.                 merged. Default - TRUE.
  1614.  
  1615.    RESULTS
  1616.         none
  1617.  
  1618.    SEE ALSO
  1619.         CreatePaletteA(), ExportPaletteA(), render/render.h
  1620.  
  1621.  
  1622. render.library/InsertAlphaChannelA         render.library/InsertAlphaChannelA
  1623.  
  1624.    NAME
  1625.         InsertAlphaChannelA - insert a alpha-channel mask to a RGB array.
  1626.         InsertAlphaChannel  - varargs stub for InsertAlphaChannelA.
  1627.  
  1628.    SYNOPSIS
  1629.         InsertAlphaChannelA(chunkyarray,width,height,rgbarray,tags)
  1630.                             a0          d0    d1     a1       a2
  1631.  
  1632.         void InsertAlphaChannelA(UBYTE *,UWORD,UWORD,ULONG *,
  1633.                                  struct TagItem *)
  1634.  
  1635.         void InsertAlphaChannel(UBYTE *,UWORD,UWORD,ULONG *,
  1636.                                 tag,...,TAG_DONE)
  1637.  
  1638.    FUNCTION
  1639.         This function inserts an array of chunky bytes to a RGB array.
  1640.         The resulting ARGB array can then be used for alpha-channel
  1641.         operations, such as provided with ApplyAlphaChannelA().
  1642.  
  1643.    INPUTS
  1644.         chunkyarray         - pointer to an array of chunky bytes
  1645.         width               - width [pixels]
  1646.         height              - height [rows]
  1647.         rgbarray            - pointer to a RGB array
  1648.         taglist             - pointer to an array of TagItems
  1649.  
  1650.    TAGS
  1651.         RND_SourceWidth (UWORD) - Total width of the chunky array [pixels].
  1652.                 Default - equals to the specified width.
  1653.  
  1654.         RND_DestWidth (UWORD) - Total width of the rgb array [pixels].
  1655.                 Default - equals to the specified width.
  1656.  
  1657.    RESULTS
  1658.         none
  1659.        
  1660.    SEE ALSO
  1661.         ExtractAlphaChannelA(), ApplyAlphaChannelA()
  1662.  
  1663.  
  1664. render.library/MapChunkyArrayA                 render.library/MapChunkyArrayA
  1665.  
  1666.    NAME
  1667.         MapChunkyArrayA - remap a chunky array.
  1668.         MapChunkyArray  - varargs stub for MapChunkyArrayA.
  1669.  
  1670.    SYNOPSIS
  1671.         success = MapChunkyArrayA(engine,sourcearray,palette,width,
  1672.         d0                        a0     a1          a2      d0    
  1673.                                   height,destarray,taglist)
  1674.                                   d1     a3        a4
  1675.  
  1676.         ULONG MapChunkyArrayA(APTR,UBYTE *,APTR,UWORD,UWORD,UBYTE *,
  1677.                               struct TagItem *)
  1678.  
  1679.         ULONG MapChunkyArray(APTR,UBYTE *,APTR,UWORD,UWORD,UBYTE *,
  1680.                              tag,...,TAG_DONE)
  1681.  
  1682.    FUNCTION
  1683.         MapChunkyArrayA() maps an array of chunky bytes to another
  1684.         chunky array.
  1685.  
  1686.    INPUTS
  1687.         engine      - pointer to a mapping-engine created
  1688.                       with CreateMapEngineA()
  1689.         sourcearray - pointer to source array of chunky pixels
  1690.         palette     - pointer to source array's palette
  1691.         width       - width to be converted [pixels]
  1692.         height      - height to be converted [rows]
  1693.         destarray   - pointer to the destination chunky array
  1694.         taglist     - pointer to an array of TagItems
  1695.  
  1696.    TAGS
  1697.         RND_SourceWidth (UWORD) - Total width of the chunky array [pixels].
  1698.                 Default - equals to the specified width.
  1699.  
  1700.         RND_DestWidth (UWORD) - Total width of the chunky array [pixels].
  1701.                 Default - equals to the specified width.
  1702.  
  1703.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  1704.                 for a secondary conversion of the pen numbers.
  1705.                 Default - NULL.
  1706.  
  1707.    RESULTS
  1708.         success - returncode to indicate whether the operation
  1709.                   succeeded. You must at least check for
  1710.                   CONV_SUCCESS.
  1711.  
  1712.    NOTES
  1713.         This function is considered low-level. Much more functionality
  1714.         is provided with ConvertChunkyA(). Mapping-engines may also be
  1715.         passed to ConvertChunkyA(), and MapChunkyArrayA() is only slightly
  1716.         faster in this case. ConvertChunkyA() is preferable under most
  1717.         circumstances. If you need to remap lots of tiny images, you
  1718.         might prefer MapChunkyArrayA(), since it has got very few overhead.
  1719.  
  1720.    SEE ALSO
  1721.         ConvertChunkyA(), MapRGBArrayA(), CreateMapEngineA()
  1722.  
  1723.  
  1724. render.library/MapRGBArrayA                       render.library/MapRGBArrayA
  1725.  
  1726.    NAME
  1727.         MapRGBArrayA - map an RGB array to chunky bytes.
  1728.         MapRGBArray  - varargs stub for MapRGBArrayA.
  1729.  
  1730.    SYNOPSIS
  1731.         success = MapRGBArrayA(engine,rgbarray,width,height,chunky,taglist)
  1732.         d0                     a0     a1       d0    d1     a2     a3
  1733.  
  1734.         ULONG MapRGBArrayA(APTR,ULONG *,UWORD,UWORD,UBYTE *,struct TagItem *)
  1735.  
  1736.         ULONG MapRGBArray(APTR,ULONG *,UWORD,UWORD,UBYTE *,tag,...,TAG_DONE)
  1737.  
  1738.    FUNCTION
  1739.         MapRGBArrayA() maps an array of RGB data to a chunky array.
  1740.  
  1741.    INPUTS
  1742.         engine      - pointer to a mapping-engine created
  1743.                       with CreateMapEngineA()
  1744.         rgbarray    - pointer to an array of RGB pixels
  1745.         width       - width to be converted [pixels]
  1746.         height      - height to be converted [rows]
  1747.         chunky      - pointer to the destination array
  1748.         taglist     - pointer to an array of TagItems
  1749.  
  1750.    TAGS
  1751.         RND_SourceWidth (UWORD) - Total width of the RGB array [pixels].
  1752.                 Default - equals to the specified width.
  1753.  
  1754.         RND_DestWidth (UWORD) - Total width of the chunky array [pixels].
  1755.                 Default - equals to the specified width.
  1756.  
  1757.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  1758.                 for a secondary conversion of the pen numbers.
  1759.                 Default - NULL.
  1760.  
  1761.    RESULTS
  1762.         success - returncode to indicate whether the operation
  1763.                   succeeded. You must at least check for
  1764.                   CONV_SUCCESS.
  1765.  
  1766.    NOTES
  1767.         - Do not use MapRGBArrayA() with ARGB (A=alpha-channel) data.
  1768.           The upper byte must be set to zero!
  1769.         - This function is considered low-level. Much more functionality
  1770.           is provided with RenderA(). Mapping-engines may also be passed
  1771.           to RenderA(), and MapRGBArrayA() is only slightly faster in this
  1772.           case. RenderA() is preferable under most circumstances. If you
  1773.           need to render lots of tiny images, you might prefer
  1774.           MapRGBArrayA(), since it has got few overhead.
  1775.  
  1776.    SEE ALSO
  1777.         RenderA(), MapChunkyArrayA(), CreateMapEngineA()
  1778.  
  1779.  
  1780. render.library/MixAlphaChannelA               render.library/MixAlphaChannelA
  1781.  
  1782.    NAME
  1783.         MixAlphachannelA - create an alpha-channel for a RGB array.
  1784.         MixAlphachannel  - varargs stub for MixAlphachannelA.
  1785.  
  1786.    SYNOPSIS
  1787.         MixAlphachannelA(sourcearray1,sourcearray2,width,height,destarray,
  1788.                          a0           a1           d0    d1     a2
  1789.                          tags)
  1790.                          a3
  1791.  
  1792.         void MixAlphachannelA(ULONG *,ULONG *,UWORD,UWORD,ULONG *,
  1793.                               struct TagItem *)
  1794.  
  1795.         void MixAlphachannel(ULONG *,ULONG*,UWORD,UWORD,ULONG *,
  1796.                              tag,...,TAG_DONE)
  1797.  
  1798.    FUNCTION
  1799.         This function does a 'weighted' alpha-channel composition of
  1800.         two RGB arrays and writes the result to a third RGB array.
  1801.         You may optionally disable one or both alpha-channel sources,
  1802.         in the latter case a 1:1 mix (without alpha-channel) will be
  1803.         performed.
  1804.  
  1805.    INPUTS
  1806.         sourcearray1        - pointer to a RGB array, source
  1807.         sourcearray2        - pointer to a RGB array, source
  1808.         width               - width [pixels]
  1809.         height              - height [rows]
  1810.         destarray           - pointer to a RGB array, destination
  1811.         taglist             - pointer to an array of TagItems
  1812.  
  1813.    TAGS
  1814.         RND_SourceWidth (UWORD) - Total width of sourcearray1 [pixels].
  1815.                 Default - equals to the specified width.
  1816.  
  1817.         RND_SourceWidth2 (UWORD) - Total width of sourcearray2 [pixels].
  1818.                 Default - equals to the specified width.
  1819.  
  1820.         RND_DestWidth (UWORD) - Total width of destarray [pixels].
  1821.                 Default - equals to the specified width.
  1822.  
  1823.         RND_AlphaChannel (ULONG) - Pointer to an alpha-channel array
  1824.                 for sourcearray1. This may be NULL. Default - equals
  1825.                 to sourcearray1.
  1826.        
  1827.         RND_AlphaWidth (UWORD) - Total width of the first alpha-channel
  1828.                 array [pixels]. Default - equals to RND_SourceWidth.
  1829.  
  1830.         RND_AlphaModulo (UWORD) - Alpha-channel pixel modulo for the
  1831.                 first alpha-channel array [bytes]. Default - 4
  1832.  
  1833.         RND_AlphaChannel2 (ULONG) - Pointer to an alpha-channel array
  1834.                 for sourcearray2. This may be NULL. Default - equals
  1835.                 to sourcearray2.
  1836.  
  1837.         RND_AlphaWidth2 (UWORD) - Total width of the second alpha-channel
  1838.                 array [pixels]. Default - equals to RND_SourceWidth2.
  1839.  
  1840.         RND_AlphaModulo2 (UWORD) - Alpha-channel pixel modulo for the
  1841.                 second alpha-channel array [bytes]. Default - 4
  1842.                 
  1843.    RESULTS
  1844.         none
  1845.  
  1846.    NOTES
  1847.         this function is much more generalized than ApplyAlphaChannelA()
  1848.         and MixRGBArrayA(), but it has got more overhead and might be
  1849.         noticably slower. read the appropriate autodoc sections to see
  1850.         if one of the above mentioned functions suffice for your particular
  1851.         purpose.
  1852.  
  1853.    SEE ALSO
  1854.         ApplyAlphaChannelA(), MixRGBArrayA(), InsertAlphaChannelA(),
  1855.         ExtractAlphaChannelA()
  1856.  
  1857.  
  1858. render.library/MixRGBArrayA                       render.library/MixRGBArrayA
  1859.  
  1860.    NAME
  1861.         MixRGBArrayA - mix two RGB arrays.
  1862.         MixRGBArray  - varargs stub for MixRGBArrayA.
  1863.  
  1864.    SYNOPSIS
  1865.         MixRGBArrayA(sourcearray,width,height,destarray,ratio,tags)
  1866.                      a0          d0    d1     a1        d2    a2
  1867.  
  1868.         void MixRGBArrayA(ULONG *,UWORD,UWORD,ULONG *,UWORD,
  1869.                           struct TagItem *)
  1870.  
  1871.         void MixRGBArray(ULONG *,UWORD,UWORD,ULONG *,UWORD,
  1872.                          tag,...,TAG_DONE)
  1873.  
  1874.    FUNCTION
  1875.         This function mixes sourcearray and destarray and writes
  1876.         the result to destarray. Unlike ApplyAlphaChannelA(), this
  1877.         function does not use any alpha-channel information.
  1878.  
  1879.    INPUTS
  1880.         sourcearray         - pointer to an ARGB array
  1881.         width               - width [pixels]
  1882.         height              - height [rows]
  1883.         destarray           - pointer to a RGB array
  1884.         ratio               - mix ratio (0...255)
  1885.         taglist             - pointer to an array of TagItems
  1886.  
  1887.    TAGS
  1888.         RND_SourceWidth (UWORD) - Total width of the source array [pixels].
  1889.                 Default - equals to the specified width.
  1890.  
  1891.         RND_DestWidth (UWORD) - Total width of the dest array [pixels].
  1892.                 Default - equals to the specified width.
  1893.  
  1894.    RESULTS
  1895.         none
  1896.        
  1897.    SEE ALSO
  1898.         ApplyAlphaChannelA()
  1899.  
  1900.  
  1901. render.library/Planar2ChunkyA                   render.library/Planar2ChunkyA
  1902.  
  1903.    NAME
  1904.         Planar2ChunkyA - convert bitplane data to chunky bytes.
  1905.         Planar2Chunky  - varargs stub for Planar2ChunkyA.
  1906.  
  1907.    SYNOPSIS
  1908.         Planar2ChunkyA(planetab,bytewidth,rows,depth,bytesperrow,
  1909.                        a0       d0        d1   d2    d3
  1910.                        chunkybuffer,taglist)
  1911.                        a1           a2
  1912.  
  1913.         void Planar2ChunkyA(PLANEPTR *,UWORD,UWORD,UWORD,UWORD,
  1914.                             UBYTE *,struct TagItem *)
  1915.         
  1916.         void Planar2Chunky(PLANEPTR *,UWORD,UWORD,UWORD,UWORD
  1917.                             UBYTE *,tag,...,TAG_DONE)
  1918.  
  1919.    FUNCTION
  1920.         This function converts raw bitplane-oriented (planar) graphics
  1921.         to an array of chunky bytes.
  1922.  
  1923.    INPUTS
  1924.         planetab    - pointer to a table of planepointers
  1925.         bytewidth   - width [bytes]. This must be an even number.
  1926.         rows        - height [rows]
  1927.         depth       - number of bitplanes in planetab
  1928.         bytesperrow - total bytes per row in the source bitplanes.
  1929.                       This must be an even number. If you convert
  1930.                       interleaved bitplanes, multiply by depth.
  1931.         chunky      - pointer to the destination chunky buffer
  1932.         taglist     - pointer to an array of TagItems
  1933.  
  1934.    TAGS
  1935.         RND_DestWidth (UWORD) - Total width of chunky array [pixels].
  1936.                 Default - equals to bytewidth * 8.
  1937.  
  1938.                 You are explicitely allowed to use a destwidth that is
  1939.                 smaller than bytewidth * 8 pixels.
  1940.                 
  1941.                 Important note:
  1942.                 If you specify this tag, you must _still_ supply a
  1943.                 chunky buffer of at least bytewidth * 8 * rows bytes.
  1944.  
  1945.    NOTES
  1946.         Starting with v39, you are not allowed to assume foreign BitMap
  1947.         structures being of a planar type. Before you grab a table of
  1948.         planepointers out of an unknown BitMap structure and pass it to
  1949.         this function, you have to check for the presence of the
  1950.         BMF_STANDARD flag.
  1951.  
  1952.    RESULTS
  1953.         none
  1954.  
  1955.    SEE ALSO
  1956.         Chunky2BitMapA(), graphics/gfx.h
  1957.  
  1958.  
  1959. render.library/QueryHistogram                   render.library/QueryHistogram
  1960.  
  1961.    NAME
  1962.         QueryHistogram - query a histogram parameter.
  1963.  
  1964.    SYNOPSIS
  1965.         value = QueryHistogram(histogram,tag)
  1966.         d0                     a0        d0
  1967.         
  1968.         ULONG QueryHistogram(APTR,Tag)
  1969.  
  1970.    FUNCTION
  1971.         Query one of a histogram's specifications
  1972.         via Tag parameter.
  1973.  
  1974.    INPUTS
  1975.         histogram - pointer to a histogram
  1976.         tag       - Tag to be queried
  1977.  
  1978.    TAGS
  1979.         RND_NumColors (ULONG) -
  1980.                 the number of different colors inside the histogram
  1981.  
  1982.         RND_NumPixels (ULONG) -
  1983.                 the number of pixels that have been added to the
  1984.                 histogram
  1985.  
  1986.         RND_RMHandler (ULONG) -
  1987.                 the histogram's render-memhandler
  1988.  
  1989.         RND_HSType (UWORD) -
  1990.                 the histogram's type
  1991.  
  1992.    RESULTS
  1993.         value    - the queried parameter
  1994.  
  1995.    SEE ALSO
  1996.         CreateHistogramA()
  1997.  
  1998.  
  1999. render.library/RenderA                                 render.library/RenderA
  2000.  
  2001.    NAME
  2002.         RenderA - render an array of RGB data to chunky bytes.
  2003.         Render  - varargs stub for RenderA.
  2004.  
  2005.    SYNOPSIS
  2006.         success = RenderA(rgb,width,height,chunky,palette,taglist)
  2007.         d0                a0  d0    d1     a1     a2      a3
  2008.         
  2009.         ULONG RenderA(ULONG *,UWORD,UWORD,UBYTE *,APTR,struct TagItem *)
  2010.         
  2011.         ULONG Render(ULONG *,UWORD,UWORD,UBYTE *,APTR,tag,...,TAG_DONE)
  2012.  
  2013.    FUNCTION
  2014.         Render an array of RGB data to an array of chunky bytes.
  2015.  
  2016.    INPUTS
  2017.         rgb         - pointer to an array of RGB pixels
  2018.         width       - width to be converted [pixels]
  2019.         height      - height to be converted [rows]
  2020.         chunky      - pointer to the destination array
  2021.         palette     - pointer to a palette to be rendered to
  2022.         taglist     - pointer to an array of TagItems
  2023.  
  2024.    TAGS
  2025.         RND_SourceWidth (UWORD) - Total width of the RGB array [pixels].
  2026.                 Default - equals to the specified width.
  2027.  
  2028.         RND_DestWidth (UWORD) - Total width of the chunky array [pixels].
  2029.                 Default - equals to the specified width.
  2030.  
  2031.         RND_ColorMode (ULONG) - Color mode that defines how to determine
  2032.                 a pixel's actual color. Valid types:
  2033.  
  2034.                 COLORMODE_CLUT          - normal palette lookup
  2035.                 COLORMODE_HAM8          - HAM8 mode palette lookup
  2036.                 COLORMODE_HAM6          - HAM6 mode palette lookup
  2037.                 
  2038.                 Default - COLORMODE_CLUT.
  2039.  
  2040.         RND_DitherMode (UWORD) - Error diffusion mode. Valid types:
  2041.  
  2042.                 DITHERMODE_NONE   - no error diffusion
  2043.  
  2044.                 DITHERMODE_FS     - Floyd-Steinberg
  2045.                                     Does not handle a dither amount.
  2046.  
  2047.                 DITHERMODE_RANDOM - Random dithering
  2048.                                     Handles RND_DitherAmount.
  2049.  
  2050.                 Default - DITHERMODE_NONE.
  2051.  
  2052.         RND_ProgressHook (ULONG) - Pointer to a callback hook
  2053.                 structure for progress display operations. Refer to
  2054.                 render/renderhooks.h for further information.
  2055.                 Default - NULL.
  2056.  
  2057.         RND_OffsetColorZero (UWORD) - First pen number to appear
  2058.                 in the rendered chunky image. This offset will be
  2059.                 added to the palette's indices. Default - 0.
  2060.                 Note: RND_PenTable overrides RND_OffsetColorZero.
  2061.  
  2062.         RND_PenTable (ULONG) - Pointer to a table of 256 UBYTEs
  2063.                 for a secondary conversion of the pen numbers.
  2064.                 Default - NULL.
  2065.                 Note: RND_PenTable overrides RND_OffsetColorZero.
  2066.  
  2067.         RND_LineHook (ULONG) - Pointer to a callback hook structure
  2068.                 for line-related operations during render. This hook
  2069.                 is executed once before a line is rendered and once
  2070.                 after it has been completed. Refer to
  2071.                 render/renderhooks.h for further information.
  2072.                 Default - NULL.
  2073.  
  2074.         RND_DitherAmount (UWORD) - Dither intensity (0-255).
  2075.                 Only valid with certain dither modes (see above).
  2076.                 Default - 128.
  2077.  
  2078.         RND_ScaleEngine (ULONG) - Pointer to a scaling-engine.
  2079.                 This scaling-engine will be used to scale the
  2080.                 source data stream before it is being rendered.
  2081.                 Default - NULL.
  2082.  
  2083.                 Notes: 
  2084.                 - The scaling engine's destination width and
  2085.                   height specifications override the width and
  2086.                   height arguments for RenderA().
  2087.                 - The scaling-engine must have been created with
  2088.                   PIXFMT_0RGB_32.
  2089.  
  2090.         RND_MapEngine (ULONG) - Pointer to a mapping-engine.
  2091.                 This can greatly improve render performance.
  2092.                 Default - NULL.
  2093.                 
  2094.                 Notes:
  2095.                 - Mapping-engines are not applied for rendering
  2096.                   to HAM modes.
  2097.                 - With dithering enabled, you better do not
  2098.                   specify a mapping-engine which was created with
  2099.                   a link to a histogram. Accurate conversion could
  2100.                   not be guaranteed in this case.
  2101.  
  2102.    RESULTS
  2103.         success - returncode to indicate whether the operation
  2104.                   succeeded. You must at least check for
  2105.                   REND_SUCCESS.
  2106.  
  2107.    NOTES
  2108.         - This function may call the progress callback Hook with
  2109.           the PMSGTYPE_LINES_RENDERED message type.
  2110.  
  2111.    SEE ALSO
  2112.         MapRGBArrayA(), ConvertChunkyA(), CreateMapEngineA(),
  2113.         CreateScaleEngineA(), render/render.h, render/renderhooks.h
  2114.  
  2115.  
  2116. render.library/RGBArrayDiversityA           render.library/RGBArrayDiversityA
  2117.  
  2118.    NAME
  2119.         RGBArrayDiversityA - calculate RGB array adaptibility
  2120.         RGBArrayDiversity  - varargs stub for RGBArrayDiversityA
  2121.  
  2122.    SYNOPSIS
  2123.         diversity = RGBArrayDiversityA(rgbarray,width,height,taglist)
  2124.         d0                             a0       d0    d1     a1
  2125.  
  2126.         LONG RGBArrayDiversityA(ULONG *,UWORD,UWORD,struct TagItem *)
  2127.  
  2128.         LONG RGBArrayDiversity(ULONG *,UWORD,UWORD,tag,...,TAG_DONE)
  2129.  
  2130.    FUNCTION
  2131.         This function calculates a RGB array's adaptibility to a palette
  2132.         or mapping-engine.
  2133.  
  2134.    INPUTS
  2135.         rgbarray - pointer to an array of RGB data
  2136.         width    - width of the RGB array [pixels]
  2137.         height   - height of the RGB array [pixels]
  2138.         taglist  - pointer to an array of tagitems
  2139.  
  2140.    TAGS
  2141.         RND_Palette (ULONG) - pointer to a palette. Either this or the
  2142.                 RND_MapEngine argument is obligatory!
  2143.  
  2144.         RND_MapEngine (ULONG) - pointer to a mapping-engine. Either this
  2145.                 or the RND_Palette argument is obligatory!
  2146.  
  2147.         RND_SourceWidth (UWORD) - Total width of the RGB array [pixels].
  2148.                 Default - equals to the specified width.
  2149.  
  2150.         RND_Interleave (ULONG) - number of pixels to skip horizontally.
  2151.                 Default - 0.
  2152.  
  2153.    RESULTS
  2154.         diversity - an indicator for the RGB array's adaptibility to
  2155.                     the given palette or mapping-engine. 0 indicates
  2156.                     perfect adaptibility, 195075 indicates the worst
  2157.                     case.
  2158.  
  2159.    IMPLEMENTATION   
  2160.         Every RGB in the source array is adapted to the specified
  2161.         palette or mapping-engine. Now assume p2 is the RGB of the
  2162.         palette entry that matches best with the requested RGB p1.
  2163.  
  2164.             R
  2165.             |
  2166.             |      * p2
  2167.             |     /
  2168.             |    /
  2169.             |   / d
  2170.             |__/_________G
  2171.            /  /
  2172.           /  * p1
  2173.          /
  2174.         B
  2175.  
  2176.         This function sums up the diversity d² for every RGB in the
  2177.         source array, and divides it by the number of pixels processed:
  2178.  
  2179.                           k=pixels
  2180.                   1         ___
  2181.         D   =   ------   .  \\  `   d(k)²
  2182.                 pixels      /__,
  2183.  
  2184.                              k=1
  2185.  
  2186.         D is returned, so what you get is the average d² for all RGB
  2187.         values that appear in the array. d² is summed up instead of d
  2188.         because it is a better indicator for most purposes.
  2189.  
  2190.         Best case - all pixels match perfectly: D(min) = 0.
  2191.         Worst case - all pixels are white, and the only available color
  2192.         in the palette is black: D(max) = 255²+255²+255² = 195075.
  2193.         
  2194.    EXAMPLE        
  2195.         D indicates a palette's applicability for the given RGB array.
  2196.         You can e.g. use it to decide whether error diffusion should be
  2197.         enabled or not.
  2198.  
  2199.         dithermode = DITHERMODE_NONE;
  2200.  
  2201.         D = RGBArrayDiversity(rgbarray, width, height, 
  2202.             RND_Palette, destpalette, RND_Interleave, 4, TAG_DONE);
  2203.  
  2204.         if (D > threshold)
  2205.         {
  2206.             dithermode = DITHERMODE_FS;
  2207.         }
  2208.  
  2209.         Render(rgbarray, width, height, chunkyarray, destpalette,
  2210.             RND_DitherMode, dithermode, TAG_DONE);
  2211.  
  2212.         The interleave factor increases speed drastically. Nonetheless,
  2213.         RGBArrayDiversity() is yet very fast. You gain a lot of
  2214.         performance if only dithering can be avoided sometimes.
  2215.  
  2216.         Applying RGBArrayDiversity() to a mapping-engine is even more
  2217.         sophisticated. Use this if a histogram is available for the RGB
  2218.         array.
  2219.  
  2220.         me = CreateMapEngine(palette,RND_Histogram,histo,TAG_DONE);
  2221.  
  2222.         D = RGBArrayDiversity(rgbarray, width, height, 
  2223.             RND_MapEngine, me, RND_Interleave, 4, TAG_DONE);
  2224.  
  2225.         if (D > threshold)
  2226.         {
  2227.             Render(rgbarray, width, height, chunkyarray, destpalette,
  2228.                 RND_DitherMode, DITHERMODE_FS, TAG_DONE);
  2229.         }
  2230.         else
  2231.         {
  2232.             MapRGBArray(me, rgbarray, width, height, chunkyarray, NULL);
  2233.         }
  2234.  
  2235.         This example provides even higher performance. MapRGBArrayA() is
  2236.         faster than RenderA(), especially when the mapping-engine is
  2237.         coupled with a histogram. Note: That mapping-engine's histogram
  2238.         has to be of a HSTYPE_..._TURBO type with the same resolution as
  2239.         the palette.
  2240.  
  2241.    SEE ALSO
  2242.         ChunkyArrayDiversityA()
  2243.  
  2244.  
  2245. render.library/ScaleA                                   render.library/ScaleA
  2246.  
  2247.    NAME
  2248.         ScaleA - scale an image.
  2249.         Scale  - varargs stub for ScaleA.
  2250.  
  2251.    SYNOPSIS
  2252.         success = ScaleA(engine,source,dest,taglist)
  2253.                          a0     a1     a2   a3
  2254.         
  2255.         ULONG ScaleA(APTR,APTR,APTR,struct TagItem *)
  2256.         
  2257.         ULONG Scale(APTR,APTR,APTR,tag,...,TAG_DONE)
  2258.  
  2259.    FUNCTION
  2260.         This function scales a source array of pixels to another
  2261.         array.
  2262.  
  2263.    INPUTS
  2264.         engine  - pointer to a scaling-engine created
  2265.                   with CreateScaleEngineA()
  2266.         source  - pointer to source array of pixels
  2267.         dest    - pointer to destination array
  2268.         taglist - pointer to an array of TagItems
  2269.  
  2270.    TAGS
  2271.         RND_SourceWidth (UWORD) - Total width of the source array [pixels].
  2272.                 Default - equals to the source width the scaling-engine
  2273.                           was created with.
  2274.  
  2275.         RND_DestWidth (UWORD) - Total width of the dest array [pixels].
  2276.                 Default - equals to the destination width the
  2277.                           scaling-engine was created with.
  2278.  
  2279.         RND_LineHook (ULONG) - Pointer to a callback hook structure
  2280.                 for line-related operations during conversion. This
  2281.                 hook is executed once before a line is processed and
  2282.                 once after it has been completed. Refer to
  2283.                 render/renderhooks.h for further information.
  2284.                 Default - NULL.
  2285.  
  2286.    RESULTS
  2287.         success - CONV_SUCCESS to indicate that the operation
  2288.                   succeeded. Currently, the only reason for this
  2289.                   function to fail is CONV_CALLBACK_ABORTED.
  2290.  
  2291.    NOTES
  2292.         - It is possible to downscale (shrink) an array over itself,
  2293.           i.e. source and destination buffers may be the same in this
  2294.           case.
  2295.  
  2296.    SEE ALSO
  2297.         CreateScaleEngineA(), RenderA(), ConvertChunkyA()
  2298.  
  2299.  
  2300. render.library/ScaleOrdinate                     render.library/ScaleOrdinate
  2301.  
  2302.    NAME
  2303.         ScaleOrdinate - scale a single ordinate.
  2304.  
  2305.    SYNOPSIS
  2306.         scaled_ordinate = ScaleOrdinate(start,dest,ordinate)
  2307.         d0                              d0    d1   d2
  2308.  
  2309.         UWORD ScaleOrdinate(UWORD,UWORD,UWORD)
  2310.  
  2311.    FUNCTION
  2312.         This function scales a single ordinate. The algorythm used here
  2313.         is identical to what scaling-engines are created with.
  2314.         
  2315.    INPUTS
  2316.         start    - original value (e.g. width or height)
  2317.                    e.g. the original width of an image.
  2318.                    This value usually corresponds to a
  2319.                    start value with CreateScaleEngineA().
  2320.                    Must not be 0.
  2321.         dest     - destination value (e.g. width or height)
  2322.                    e.g. the scaled width of an image.
  2323.                    This value usually corresponds to a
  2324.                    dest value with CreateScaleEngineA().
  2325.                    Must not be 0.
  2326.         ordinate - a single ordinate (e.g. of a pixel).
  2327.                    Must be less than <start>.
  2328.  
  2329.    RESULTS
  2330.         scaled_ordinate - the new ordinate (after scaling)
  2331.         
  2332.    EXAMPLE        
  2333.         Assume you have a specific pair of coordinates that represent a
  2334.         particular pixel inside an image. You can use this function to
  2335.         determine the pixel's new coordinates after the image has been
  2336.         scaled:
  2337.  
  2338.         new_pixel_x = ScaleOrdinate(picwidth,newwidth,pixel_x);
  2339.         new_pixel_y = ScaleOrdinate(picheight,newheight,pixel_y);
  2340.  
  2341.    SEE ALSO
  2342.         CreateScaleEngineA()
  2343.  
  2344.  
  2345. render.library/SortPaletteA                       render.library/SortPaletteA
  2346.  
  2347.    NAME
  2348.         SortPaletteA - sort a palette.
  2349.         SortPalette  - varargs stub for SortPaletteA.
  2350.  
  2351.    SYNOPSIS
  2352.         success = SortPaletteA(palette,mode,taglist)
  2353.         d0                     a0      d0   a1
  2354.         
  2355.         ULONG SortPaletteA(APTR,ULONG,struct TagItem *)
  2356.         
  2357.         ULONG SortPalette(APTR,ULONG,tag,...,TAG_DONE)
  2358.  
  2359.    FUNCTION
  2360.         Sorts a palette according to a sort mode. Some sort modes apply
  2361.         to palettes solely, some others additionally require a
  2362.         histogram.
  2363.  
  2364.    INPUTS
  2365.         palette - pointer to a palette created
  2366.                   with CreatePaletteA().
  2367.  
  2368.         mode    - sort mode. Currently defined are:
  2369.  
  2370.                   PALMODE_BRIGHTNESS      - sort the palette entries
  2371.                                 by brightness.
  2372.  
  2373.                   PALMODE_SATURATION      - sort the palette entries
  2374.                                 by their color intensity.
  2375.  
  2376.                   PALMODE_POPULARITY      - sort the palette entries
  2377.                                 by the number of pixels that they
  2378.                                 represent. You must specify the
  2379.                                 RND_Histogram taglist argument.
  2380.  
  2381.                   PALMODE_REPRESENTATION  - sort the palette entries
  2382.                                 by the number of histogram entries
  2383.                                 that they represent. You must specify
  2384.                                 the RND_Histogram taglist argument.
  2385.                   
  2386.                   PALMODE_SIGNIFICANCE    - sort the palette entries
  2387.                                 by their optical significance for the
  2388.                                 human eye. Implementation is unknown
  2389.                                 to you and may change. You must supply
  2390.                                 the RND_Histogram taglist argument.
  2391.  
  2392.                   PALMODE_ASCENDING       - by default, sort direction
  2393.                                 is descending, i.e. precedence is
  2394.                                 `more-to-less' of the given effect.
  2395.                                 Combine with this flag to invert the
  2396.                                 sort direction.
  2397.  
  2398.         taglist - pointer to an array of tagitems.
  2399.  
  2400.    TAGS
  2401.         RND_Histogram (ULONG) - pointer to a histogram. This taglist
  2402.                argument is obligatory for some sort modes. (See above)
  2403.  
  2404.    RESULTS
  2405.         success - return value to indicate whether the operation succeeded.
  2406.                   You must at least check for SORTP_SUCCESS.
  2407.  
  2408.    NOTES
  2409.         SortPaletteA() can be extremely useful when a palette is to be
  2410.         allocated from a ColorMap via ObtainBestPenA(). After sorting
  2411.         with PALMODE_SIGNIFICANCE, important colors will be treated
  2412.         first. This increases probability for ObtainBestPenA() to
  2413.         allocate new pens for the most significant entries in the
  2414.         palette.
  2415.  
  2416.  
  2417.